import pytest
import os
import time
from pom.baseActivity import BaSeActivity

screenshots = os.path.join( os.path.dirname(__file__),'../screenshots')
if not os.path.exists(screenshots):
    os.mkdir(screenshots)

@pytest.fixture(scope='function',autouse=True)
def scope_func():
    baseAct = BaSeActivity()
    yield
    # 截图操作
    filename=os.path.join(screenshots, str(time.time()) +'.png')
    baseAct.driver.save_screenshot(filename)
